package file;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("pw2.txt",true);
        OutputStreamWriter opw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(opw);
        PrintWriter pw = new PrintWriter(bw);
        pw.println("喜欢你，没道理");
        System.out.println("写出完毕");
        pw.close();
    }
}
